home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 16 / IOPROG_16.ISO / soft / macaxsdk / macsdk.hqx / ActiveX DR3 SDK / ActiveX SDK / Container Common / pullstream.cpp < prev    next >
MacBinary  |  1997-08-04  |  10.0 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
20% dexvert Blazing Paddles (image/blazingPaddles) fileSize Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Mon Aug 4 17:15:30 1997, modified Mon Aug 4 17:15:30 1997, creator 'CWIE', type ASCII, 9510 bytes "pullstream.cpp" , at 0x25a6 474 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0e 70 75 6c 6c 73 74 | 72 65 61 6d 2e 63 70 70 |..pullst|ream.cpp|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 25 26 00 | 00 01 da b0 0b f6 f2 b0 |.....%&.|........|
|00000060| 0b f6 f2 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 96 3e 00 00 |........|.....>..|
|00000080| 2f 2f 0d 2f 2f 20 20 50 | 75 6c 6c 53 74 72 65 61 |//.// P|ullStrea|
|00000090| 6d 2e 43 50 50 0d 2f 2f | 0d 2f 2f 20 3e 3e 3e 20 |m.CPP.//|.// >>> |
|000000a0| a9 20 31 39 39 36 2d 31 | 39 39 37 20 4d 69 63 72 |. 1996-1|997 Micr|
|000000b0| 6f 73 6f 66 74 20 43 6f | 72 70 6f 72 61 74 69 6f |osoft Co|rporatio|
|000000c0| 6e 2e 20 20 41 6c 6c 20 | 72 69 67 68 74 73 20 72 |n. All |rights r|
|000000d0| 65 73 65 72 76 65 64 2e | 20 3c 3c 3c 0d 2f 2f 0d |eserved.| <<<.//.|
|000000e0| 2f 2f 20 20 49 6d 70 6c | 65 6d 65 6e 74 73 20 70 |// Impl|ements p|
|000000f0| 75 6c 6c 2d 64 61 74 61 | 20 74 79 70 65 20 73 74 |ull-data| type st|
|00000100| 72 65 61 6d 20 61 63 63 | 65 73 73 0d 2f 2f 0d 0d |ream acc|ess.//..|
|00000110| 23 69 6e 63 6c 75 64 65 | 20 22 41 58 43 6f 6e 74 |#include| "AXCont|
|00000120| 61 69 6e 65 72 48 65 61 | 64 65 72 73 2e 68 22 0d |ainerHea|ders.h".|
|00000130| 0d 65 78 74 65 72 6e 20 | 46 4f 52 4d 41 54 45 54 |.extern |FORMATET|
|00000140| 43 20 67 5f 4e 75 6c 6c | 46 6f 72 6d 61 74 45 74 |C g_Null|FormatEt|
|00000150| 63 3b 0d 0d 0d 2f 2f 0d | 2f 2f 20 20 43 50 75 6c |c;...//.|// CPul|
|00000160| 6c 53 74 72 65 61 6d 4e | 6f 74 69 66 79 3a 3a 7e |lStreamN|otify::~|
|00000170| 43 50 75 6c 6c 53 74 72 | 65 61 6d 4e 6f 74 69 66 |CPullStr|eamNotif|
|00000180| 79 0d 2f 2f 0d 0d 43 50 | 75 6c 6c 53 74 72 65 61 |y.//..CP|ullStrea|
|00000190| 6d 4e 6f 74 69 66 79 3a | 3a 7e 43 50 75 6c 6c 53 |mNotify:|:~CPullS|
|000001a0| 74 72 65 61 6d 4e 6f 74 | 69 66 79 28 29 0d 7b 0d |treamNot|ify().{.|
|000001b0| 20 20 20 20 69 66 20 28 | 6d 5f 70 53 74 72 65 61 | if (|m_pStrea|
|000001c0| 6d 20 21 3d 20 4e 55 4c | 4c 29 0d 20 20 20 20 20 |m != NUL|L). |
|000001d0| 20 20 20 43 6f 54 61 73 | 6b 4d 65 6d 46 72 65 65 | CoTas|kMemFree|
|000001e0| 28 6d 5f 70 53 74 72 65 | 61 6d 29 3b 0d 7d 0d 0d |(m_pStre|am);.}..|
|000001f0| 2f 2f 0d 2f 2f 20 20 43 | 50 75 6c 6c 53 74 72 65 |//.// C|PullStre|
|00000200| 61 6d 4e 6f 74 69 66 79 | 3a 3a 4f 6e 57 72 69 74 |amNotify|::OnWrit|
|00000210| 65 0d 2f 2f 0d 0d 69 6e | 74 33 32 0d 43 50 75 6c |e.//..in|t32.CPul|
|00000220| 6c 53 74 72 65 61 6d 4e | 6f 74 69 66 79 3a 3a 4f |lStreamN|otify::O|
|00000230| 6e 57 72 69 74 65 28 4e | 50 53 74 72 65 61 6d 20 |nWrite(N|PStream |
|00000240| 2a 73 74 72 65 61 6d 2c | 20 69 6e 74 33 32 20 6f |*stream,| int32 o|
|00000250| 66 66 73 65 74 2c 20 69 | 6e 74 33 32 20 6c 65 6e |ffset, i|nt32 len|
|00000260| 2c 20 76 6f 69 64 0d 20 | 20 20 20 2a 62 75 66 66 |, void. | *buff|
|00000270| 65 72 29 0d 7b 0d 23 70 | 72 61 67 6d 61 20 75 6e |er).{.#p|ragma un|
|00000280| 75 73 65 64 20 28 73 74 | 72 65 61 6d 2c 20 6f 66 |used (st|ream, of|
|00000290| 66 73 65 74 29 0d 20 20 | 20 20 69 6e 74 33 32 20 |fset). | int32 |
|000002a0| 42 79 74 65 73 57 72 69 | 74 74 65 6e 3b 0d 0d 20 |BytesWri|tten;.. |
|000002b0| 20 20 20 69 66 20 28 6d | 5f 70 53 74 72 65 61 6d | if (m|_pStream|
|000002c0| 20 3d 3d 20 4e 55 4c 4c | 29 0d 20 20 20 20 20 20 | == NULL|). |
|000002d0| 20 20 6d 5f 70 53 74 72 | 65 61 6d 20 3d 20 28 4c | m_pStr|eam = (L|
|000002e0| 50 56 4f 49 44 29 20 43 | 6f 54 61 73 6b 4d 65 6d |PVOID) C|oTaskMem|
|000002f0| 41 6c 6c 6f 63 28 53 54 | 52 45 41 4d 5f 42 55 46 |Alloc(ST|REAM_BUF|
|00000300| 46 45 52 5f 53 49 5a 45 | 29 3b 0d 0d 20 20 20 20 |FER_SIZE|);.. |
|00000310| 69 66 20 28 28 6d 5f 53 | 74 72 65 61 6d 4c 65 6e |if ((m_S|treamLen|
|00000320| 67 74 68 20 2b 20 6c 65 | 6e 29 20 3c 3d 20 53 54 |gth + le|n) <= ST|
|00000330| 52 45 41 4d 5f 42 55 46 | 46 45 52 5f 53 49 5a 45 |REAM_BUF|FER_SIZE|
|00000340| 29 0d 20 20 20 20 7b 0d | 20 20 20 20 20 20 20 20 |). {.| |
|00000350| 42 6c 6f 63 6b 4d 6f 76 | 65 28 62 75 66 66 65 72 |BlockMov|e(buffer|
|00000360| 2c 20 28 28 4c 50 42 59 | 54 45 29 20 6d 5f 70 53 |, ((LPBY|TE) m_pS|
|00000370| 74 72 65 61 6d 20 2b 20 | 6d 5f 53 74 72 65 61 6d |tream + |m_Stream|
|00000380| 4c 65 6e 67 74 68 29 2c | 20 6c 65 6e 29 3b 0d 20 |Length),| len);. |
|00000390| 20 20 20 20 20 20 20 6d | 5f 53 74 72 65 61 6d 4c | m|_StreamL|
|000003a0| 65 6e 67 74 68 20 2b 3d | 20 6c 65 6e 3b 0d 20 20 |ength +=| len;. |
|000003b0| 20 20 20 20 20 20 42 79 | 74 65 73 57 72 69 74 74 | By|tesWritt|
|000003c0| 65 6e 20 3d 20 6c 65 6e | 3b 0d 20 20 20 20 7d 0d |en = len|;. }.|
|000003d0| 20 20 20 20 65 6c 73 65 | 0d 20 20 20 20 7b 0d 20 | else|. {. |
|000003e0| 20 20 20 20 20 20 20 2f | 2f 20 20 52 65 74 75 72 | /|/ Retur|
|000003f0| 6e 69 6e 67 20 61 20 6e | 65 67 61 74 69 76 65 20 |ning a n|egative |
|00000400| 76 61 6c 75 65 20 63 61 | 75 73 65 73 20 74 68 65 |value ca|uses the|
|00000410| 20 73 74 72 65 61 6d 20 | 74 6f 20 65 72 72 6f 72 | stream |to error|
|00000420| 20 6f 75 74 20 61 6e 64 | 20 62 65 0d 20 20 20 20 | out and| be. |
|00000430| 20 20 20 20 2f 2f 20 20 | 64 65 73 74 72 6f 79 65 | // |destroye|
|00000440| 64 2e 0d 20 20 20 20 20 | 20 20 20 42 79 74 65 73 |d.. | Bytes|
|00000450| 57 72 69 74 74 65 6e 20 | 3d 20 2d 31 3b 0d 20 20 |Written |= -1;. |
|00000460| 20 20 7d 0d 20 20 20 20 | 0d 20 20 20 20 6d 5f 52 | }. |. m_R|
|00000470| 65 61 64 79 54 6f 52 65 | 61 64 20 2d 3d 20 6c 65 |eadyToRe|ad -= le|
|00000480| 6e 3b 0d 0d 20 20 20 20 | 72 65 74 75 72 6e 20 42 |n;.. |return B|
|00000490| 79 74 65 73 57 72 69 74 | 74 65 6e 3b 0d 7d 0d 0d |ytesWrit|ten;.}..|
|000004a0| 69 6e 74 33 32 0d 43 50 | 75 6c 6c 53 74 72 65 61 |int32.CP|ullStrea|
|000004b0| 6d 4e 6f 74 69 66 79 3a | 3a 4f 6e 57 72 69 74 65 |mNotify:|:OnWrite|
|000004c0| 52 65 61 64 79 28 4e 50 | 53 74 72 65 61 6d 20 2a |Ready(NP|Stream *|
|000004d0| 73 74 72 65 61 6d 29 0d | 7b 0d 23 70 72 61 67 6d |stream).|{.#pragm|
|000004e0| 61 20 75 6e 75 73 65 64 | 20 28 73 74 72 65 61 6d |a unused| (stream|
|000004f0| 29 0d 20 20 20 20 72 65 | 74 75 72 6e 20 6d 5f 52 |). re|turn m_R|
|00000500| 65 61 64 79 54 6f 52 65 | 61 64 3b 0d 7d 0d 0d 2f |eadyToRe|ad;.}../|
|00000510| 2f 0d 2f 2f 20 20 43 50 | 75 6c 6c 4f 6c 65 53 74 |/.// CP|ullOleSt|
|00000520| 72 65 61 6d 4e 6f 74 69 | 66 79 3a 3a 49 55 6e 6b |reamNoti|fy::IUnk|
|00000530| 6e 6f 77 6e 3a 3a 51 75 | 65 72 79 49 6e 74 65 72 |nown::Qu|eryInter|
|00000540| 66 61 63 65 0d 2f 2f 0d | 0d 53 54 44 4d 45 54 48 |face.//.|.STDMETH|
|00000550| 4f 44 49 4d 50 0d 43 50 | 75 6c 6c 4f 6c 65 53 74 |ODIMP.CP|ullOleSt|
|00000560| 72 65 61 6d 4e 6f 74 69 | 66 79 3a 3a 51 75 65 72 |reamNoti|fy::Quer|
|00000570| 79 49 6e 74 65 72 66 61 | 63 65 28 52 45 46 49 49 |yInterfa|ce(REFII|
|00000580| 44 20 72 69 69 64 2c 20 | 4c 50 56 4f 49 44 20 2a |D riid, |LPVOID *|
|00000590| 70 70 76 4f 62 6a 29 0d | 7b 0d 20 20 20 20 48 52 |ppvObj).|{. HR|
|000005a0| 45 53 55 4c 54 20 68 72 | 3b 0d 20 20 20 20 4c 50 |ESULT hr|;. LP|
|000005b0| 56 4f 49 44 20 70 76 3b | 0d 0d 20 20 20 20 69 66 |VOID pv;|.. if|
|000005c0| 20 28 72 69 69 64 20 3d | 3d 20 49 49 44 5f 49 55 | (riid =|= IID_IU|
|000005d0| 6e 6b 6e 6f 77 6e 20 7c | 7c 20 72 69 69 64 20 3d |nknown ||| riid =|
|000005e0| 3d 20 49 49 44 5f 49 53 | 74 72 65 61 6d 29 20 7b |= IID_IS|tream) {|
|000005f0| 0d 20 20 20 20 20 20 20 | 20 70 76 20 3d 20 28 4c |. | pv = (L|
|00000600| 50 56 4f 49 44 29 28 4c | 50 53 54 52 45 41 4d 29 |PVOID)(L|PSTREAM)|
|00000610| 20 74 68 69 73 3b 0d 20 | 20 20 20 20 20 20 20 2b | this;. | +|
|00000620| 2b 6d 5f 63 52 65 66 3b | 0d 20 20 20 20 20 20 20 |+m_cRef;|. |
|00000630| 20 68 72 20 3d 20 52 65 | 73 75 6c 74 46 72 6f 6d | hr = Re|sultFrom|
|00000640| 53 63 6f 64 65 28 53 5f | 4f 4b 29 3b 0d 20 20 20 |Scode(S_|OK);. |
|00000650| 20 7d 20 65 6c 73 65 20 | 7b 0d 20 20 20 20 20 20 | } else |{. |
|00000660| 20 20 70 76 20 3d 20 4e | 55 4c 4c 3b 0d 20 20 20 | pv = N|ULL;. |
|00000670| 20 20 20 20 20 68 72 20 | 3d 20 52 65 73 75 6c 74 | hr |= Result|
|00000680| 46 72 6f 6d 53 63 6f 64 | 65 28 45 5f 4e 4f 49 4e |FromScod|e(E_NOIN|
|00000690| 54 45 52 46 41 43 45 29 | 3b 0d 20 20 20 20 7d 0d |TERFACE)|;. }.|
|000006a0| 0d 20 20 20 20 2a 70 70 | 76 4f 62 6a 20 3d 20 70 |. *pp|vObj = p|
|000006b0| 76 3b 0d 20 20 20 20 72 | 65 74 75 72 6e 20 68 72 |v;. r|eturn hr|
|000006c0| 3b 0d 7d 0d 0d 2f 2f 0d | 2f 2f 20 20 43 50 75 6c |;.}..//.|// CPul|
|000006d0| 6c 4f 6c 65 53 74 72 65 | 61 6d 4e 6f 74 69 66 79 |lOleStre|amNotify|
|000006e0| 3a 3a 49 55 6e 6b 6e 6f | 77 6e 3a 3a 41 64 64 52 |::IUnkno|wn::AddR|
|000006f0| 65 66 0d 2f 2f 0d 0d 53 | 54 44 4d 45 54 48 4f 44 |ef.//..S|TDMETHOD|
|00000700| 49 4d 50 5f 28 55 4c 4f | 4e 47 29 0d 43 50 75 6c |IMP_(ULO|NG).CPul|
|00000710| 6c 4f 6c 65 53 74 72 65 | 61 6d 4e 6f 74 69 66 79 |lOleStre|amNotify|
|00000720| 3a 3a 41 64 64 52 65 66 | 28 76 6f 69 64 29 0d 7b |::AddRef|(void).{|
|00000730| 0d 20 20 20 20 72 65 74 | 75 72 6e 20 2b 2b 6d 5f |. ret|urn ++m_|
|00000740| 63 52 65 66 3b 0d 7d 0d | 0d 2f 2f 0d 2f 2f 20 20 |cRef;.}.|.//.// |
|00000750| 43 50 75 6c 6c 4f 6c 65 | 53 74 72 65 61 6d 4e 6f |CPullOle|StreamNo|
|00000760| 74 69 66 79 3a 3a 49 55 | 6e 6b 6e 6f 77 6e 3a 3a |tify::IU|nknown::|
|00000770| 52 65 6c 65 61 73 65 0d | 2f 2f 0d 0d 53 54 44 4d |Release.|//..STDM|
|00000780| 45 54 48 4f 44 49 4d 50 | 5f 28 55 4c 4f 4e 47 29 |ETHODIMP|_(ULONG)|
|00000790| 0d 43 50 75 6c 6c 4f 6c | 65 53 74 72 65 61 6d 4e |.CPullOl|eStreamN|
|000007a0| 6f 74 69 66 79 3a 3a 52 | 65 6c 65 61 73 65 28 76 |otify::R|elease(v|
|000007b0| 6f 69 64 29 0d 7b 0d 20 | 20 20 20 69 66 20 28 2d |oid).{. | if (-|
|000007c0| 2d 6d 5f 63 52 65 66 20 | 21 3d 20 30 29 0d 20 20 |-m_cRef |!= 0). |
|000007d0| 20 20 20 20 20 20 72 65 | 74 75 72 6e 20 6d 5f 63 | re|turn m_c|
|000007e0| 52 65 66 3b 0d 0d 20 20 | 20 20 64 65 6c 65 74 65 |Ref;.. | delete|
|000007f0| 20 74 68 69 73 3b 0d 20 | 20 20 20 72 65 74 75 72 | this;. | retur|
|00000800| 6e 20 30 3b 0d 7d 0d 0d | 2f 2f 0d 2f 2f 20 20 43 |n 0;.}..|//.// C|
|00000810| 50 75 6c 6c 4f 6c 65 53 | 74 72 65 61 6d 4e 6f 74 |PullOleS|treamNot|
|00000820| 69 66 79 3a 3a 49 53 74 | 72 65 61 6d 3a 3a 52 65 |ify::ISt|ream::Re|
|00000830| 61 64 0d 2f 2f 0d 0d 53 | 54 44 4d 45 54 48 4f 44 |ad.//..S|TDMETHOD|
|00000840| 49 4d 50 0d 43 50 75 6c | 6c 4f 6c 65 53 74 72 65 |IMP.CPul|lOleStre|
|00000850| 61 6d 4e 6f 74 69 66 79 | 3a 3a 52 65 61 64 28 76 |amNotify|::Read(v|
|00000860| 6f 69 64 20 2a 70 76 2c | 20 44 57 4f 52 44 20 63 |oid *pv,| DWORD c|
|00000870| 62 2c 20 4c 50 44 57 4f | 52 44 20 70 63 62 52 65 |b, LPDWO|RD pcbRe|
|00000880| 61 64 29 0d 7b 0d 20 20 | 20 20 2f 2f 20 20 56 65 |ad).{. | // Ve|
|00000890| 72 69 66 79 20 74 68 61 | 74 20 77 65 27 72 65 20 |rify tha|t we're |
|000008a0| 6e 6f 74 20 74 72 79 20 | 74 6f 20 72 65 61 64 20 |not try |to read |
|000008b0| 6d 6f 72 65 20 62 79 74 | 65 73 20 74 68 61 6e 20 |more byt|es than |
|000008c0| 61 72 65 20 61 76 61 69 | 6c 61 62 6c 65 2e 20 20 |are avai|lable. |
|000008d0| 49 66 20 77 65 0d 20 20 | 20 20 2f 2f 20 20 61 72 |If we. | // ar|
|000008e0| 65 2c 20 63 6c 69 70 20 | 74 68 65 20 61 63 74 75 |e, clip |the actu|
|000008f0| 61 6c 20 6e 75 6d 62 65 | 72 20 6f 66 20 62 79 74 |al numbe|r of byt|
|00000900| 65 73 20 63 6f 70 69 65 | 64 2e 20 20 54 68 65 20 |es copie|d. The |
|00000910| 4f 4c 45 33 32 20 6d 65 | 6d 6f 72 79 20 73 74 72 |OLE32 me|mory str|
|00000920| 65 61 6d 0d 20 20 20 20 | 2f 2f 20 20 69 6d 70 6c |eam. |// impl|
|00000930| 65 6d 65 6e 74 61 74 69 | 6f 6e 20 64 6f 65 73 6e |ementati|on doesn|
|00000940| 27 74 20 72 65 74 75 72 | 6e 20 61 6e 20 65 72 72 |'t retur|n an err|
|00000950| 6f 72 2c 20 73 6f 20 77 | 65 20 77 6f 6e 27 74 20 |or, so w|e won't |
|00000960| 65 69 74 68 65 72 2e 0d | 20 20 20 20 69 66 20 28 |either..| if (|
|00000970| 28 28 4c 4f 4e 47 29 20 | 63 62 20 3c 20 30 29 20 |((LONG) |cb < 0) |
|00000980| 7c 7c 20 28 63 62 20 2b | 20 28 55 4c 4f 4e 47 29 ||| (cb +| (ULONG)|
|00000990| 20 6d 5f 53 65 65 6b 50 | 6f 73 69 74 69 6f 6e 20 | m_SeekP|osition |
|000009a0| 3e 20 28 55 4c 4f 4e 47 | 29 20 6d 5f 53 74 72 65 |> (ULONG|) m_Stre|
|000009b0| 61 6d 4c 65 6e 67 74 68 | 29 29 0d 20 20 20 20 7b |amLength|)). {|
|000009c0| 0d 20 20 20 20 20 20 20 | 20 69 66 20 28 6d 5f 66 |. | if (m_f|
|000009d0| 41 73 79 6e 63 53 74 72 | 65 61 6d 49 6e 50 72 6f |AsyncStr|eamInPro|
|000009e0| 67 72 65 73 73 29 0d 20 | 20 20 20 20 20 20 20 7b |gress). | {|
|000009f0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 2f 2f 20 |. | // |
|00000a00| 20 53 70 65 63 69 61 6c | 20 63 61 73 65 3a 20 69 | Special| case: i|
|00000a10| 66 20 77 65 27 72 65 20 | 69 6e 20 74 68 65 20 6d |f we're |in the m|
|00000a20| 69 64 64 6c 65 20 6f 66 | 20 73 74 72 65 61 6d 69 |iddle of| streami|
|00000a30| 6e 67 20 73 6f 6d 65 20 | 64 61 74 61 20 66 72 6f |ng some |data fro|
|00000a40| 6d 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2f |m. | //|
|00000a50| 20 20 74 68 65 20 6e 65 | 74 77 6f 72 6b 2c 20 72 | the ne|twork, r|
|00000a60| 65 74 75 72 6e 20 45 5f | 50 45 4e 44 49 4e 47 20 |eturn E_|PENDING |
|00000a70| 73 6f 20 74 68 61 74 20 | 61 73 79 6e 63 20 62 69 |so that |async bi|
|00000a80| 6e 64 69 6e 67 20 77 6f | 72 6b 73 0d 20 20 20 20 |nding wo|rks. |
|00000a90| 20 20 20 20 20 20 20 20 | 2f 2f 20 20 63 6f 72 72 | |// corr|
|00000aa0| 65 63 74 6c 79 2e 0d 20 | 20 20 20 20 20 20 20 20 |ectly.. | |
|00000ab0| 20 20 20 2f 2f 20 20 42 | 55 47 42 55 47 3a 20 20 | // B|UGBUG: |
|00000ac0| 41 62 6f 76 65 20 69 66 | 20 73 74 61 74 65 6d 65 |Above if| stateme|
|00000ad0| 6e 74 20 70 72 6f 62 61 | 62 6c 79 20 69 73 6e 27 |nt proba|bly isn'|
|00000ae0| 74 20 61 64 65 71 75 61 | 74 65 2c 20 72 65 76 69 |t adequa|te, revi|
|00000af0| 65 77 20 74 68 69 73 2e | 0d 20 20 20 20 20 20 20 |ew this.|. |
|00000b00| 20 20 20 20 20 72 65 74 | 75 72 6e 20 52 65 73 75 | ret|urn Resu|
|00000b10| 6c 74 46 72 6f 6d 53 63 | 6f 64 65 28 45 5f 50 45 |ltFromSc|ode(E_PE|
|00000b20| 4e 44 49 4e 47 29 3b 0d | 20 20 20 20 20 20 20 20 |NDING);.| |
|00000b30| 7d 20 0d 20 20 20 20 20 | 20 20 20 65 6c 73 65 0d |} . | else.|
|00000b40| 20 20 20 20 20 20 20 20 | 7b 0d 20 20 20 20 20 20 | |{. |
|00000b50| 20 20 20 20 20 20 63 62 | 20 3d 20 6d 5f 53 74 72 | cb| = m_Str|
|00000b60| 65 61 6d 4c 65 6e 67 74 | 68 20 2d 20 6d 5f 53 65 |eamLengt|h - m_Se|
|00000b70| 65 6b 50 6f 73 69 74 69 | 6f 6e 3b 0d 20 20 20 20 |ekPositi|on;. |
|00000b80| 20 20 20 20 7d 0d 20 20 | 20 20 7d 0d 0d 20 20 20 | }. | }.. |
|00000b90| 20 69 66 20 28 63 62 20 | 3e 20 30 29 0d 20 20 20 | if (cb |> 0). |
|00000ba0| 20 7b 0d 20 20 20 20 20 | 20 20 20 42 6c 6f 63 6b | {. | Block|
|00000bb0| 4d 6f 76 65 28 28 4c 50 | 42 59 54 45 29 20 6d 5f |Move((LP|BYTE) m_|
|00000bc0| 70 53 74 72 65 61 6d 20 | 2b 20 6d 5f 53 65 65 6b |pStream |+ m_Seek|
|00000bd0| 50 6f 73 69 74 69 6f 6e | 2c 20 70 76 2c 20 63 62 |Position|, pv, cb|
|00000be0| 29 3b 0d 20 20 20 20 20 | 20 20 20 6d 5f 53 65 65 |);. | m_See|
|00000bf0| 6b 50 6f 73 69 74 69 6f | 6e 20 2b 3d 20 63 62 3b |kPositio|n += cb;|
|00000c00| 0d 20 20 20 20 7d 0d 0d | 20 20 20 20 69 66 20 28 |. }..| if (|
|00000c10| 70 63 62 52 65 61 64 20 | 21 3d 20 4e 55 4c 4c 29 |pcbRead |!= NULL)|
|00000c20| 0d 20 20 20 20 20 20 20 | 20 2a 70 63 62 52 65 61 |. | *pcbRea|
|00000c30| 64 20 3d 20 63 62 3b 0d | 0d 09 2f 2f 20 69 66 20 |d = cb;.|..// if |
|00000c40| 61 6c 6c 20 64 61 74 61 | 20 68 61 73 20 62 65 65 |all data| has bee|
|00000c50| 6e 20 72 65 61 64 2c 20 | 70 75 6c 6c 20 61 6e 6f |n read, |pull ano|
|00000c60| 74 68 65 72 20 62 75 66 | 66 65 72 20 66 75 6c 6c |ther buf|fer full|
|00000c70| 0d 09 69 66 28 6d 5f 52 | 65 61 64 79 54 6f 52 65 |..if(m_R|eadyToRe|
|00000c80| 61 64 20 3d 3d 20 30 20 | 26 26 20 6d 5f 53 65 65 |ad == 0 |&& m_See|
|00000c90| 6b 50 6f 73 69 74 69 6f | 6e 20 3e 3d 20 53 54 52 |kPositio|n >= STR|
|00000ca0| 45 41 4d 5f 42 55 46 46 | 45 52 5f 53 49 5a 45 29 |EAM_BUFF|ER_SIZE)|
|00000cb0| 0d 09 7b 0d 09 09 6d 5f | 53 65 65 6b 50 6f 73 69 |..{...m_|SeekPosi|
|00000cc0| 74 69 6f 6e 20 3d 20 30 | 3b 0d 09 09 6d 5f 53 74 |tion = 0|;...m_St|
|00000cd0| 72 65 61 6d 4c 65 6e 67 | 74 68 20 3d 20 30 3b 0d |reamLeng|th = 0;.|
|00000ce0| 09 09 6d 5f 52 65 61 64 | 79 54 6f 52 65 61 64 20 |..m_Read|yToRead |
|00000cf0| 3d 20 53 54 52 45 41 4d | 5f 42 55 46 46 45 52 5f |= STREAM|_BUFFER_|
|00000d00| 53 49 5a 45 3b 0d 09 7d | 0d 0d 20 20 20 20 72 65 |SIZE;..}|.. re|
|00000d10| 74 75 72 6e 20 52 65 73 | 75 6c 74 46 72 6f 6d 53 |turn Res|ultFromS|
|00000d20| 63 6f 64 65 28 53 5f 4f | 4b 29 3b 0d 7d 0d 0d 2f |code(S_O|K);.}../|
|00000d30| 2f 0d 2f 2f 20 20 43 50 | 75 6c 6c 4f 6c 65 53 74 |/.// CP|ullOleSt|
|00000d40| 72 65 61 6d 4e 6f 74 69 | 66 79 3a 3a 49 53 74 72 |reamNoti|fy::IStr|
|00000d50| 65 61 6d 3a 3a 57 72 69 | 74 65 0d 2f 2f 0d 0d 53 |eam::Wri|te.//..S|
|00000d60| 54 44 4d 45 54 48 4f 44 | 49 4d 50 0d 43 50 75 6c |TDMETHOD|IMP.CPul|
|00000d70| 6c 4f 6c 65 53 74 72 65 | 61 6d 4e 6f 74 69 66 79 |lOleStre|amNotify|
|00000d80| 3a 3a 57 72 69 74 65 28 | 76 6f 69 64 20 63 6f 6e |::Write(|void con|
|00000d90| 73 74 20 2a 70 76 2c 20 | 44 57 4f 52 44 20 63 62 |st *pv, |DWORD cb|
|00000da0| 2c 20 4c 50 44 57 4f 52 | 44 20 70 63 62 57 72 69 |, LPDWOR|D pcbWri|
|00000db0| 74 74 65 6e 29 0d 7b 0d | 23 70 72 61 67 6d 61 20 |tten).{.|#pragma |
|00000dc0| 75 6e 75 73 65 64 20 28 | 70 76 2c 20 63 62 2c 20 |unused (|pv, cb, |
|00000dd0| 70 63 62 57 72 69 74 74 | 65 6e 29 0d 20 20 20 20 |pcbWritt|en). |
|00000de0| 72 65 74 75 72 6e 20 52 | 65 73 75 6c 74 46 72 6f |return R|esultFro|
|00000df0| 6d 53 63 6f 64 65 28 53 | 54 47 5f 45 5f 41 43 43 |mScode(S|TG_E_ACC|
|00000e00| 45 53 53 44 45 4e 49 45 | 44 29 3b 0d 7d 0d 0d 2f |ESSDENIE|D);.}../|
|00000e10| 2f 0d 2f 2f 20 20 43 50 | 75 6c 6c 4f 6c 65 53 74 |/.// CP|ullOleSt|
|00000e20| 72 65 61 6d 4e 6f 74 69 | 66 79 3a 3a 49 53 74 72 |reamNoti|fy::IStr|
|00000e30| 65 61 6d 3a 3a 53 65 65 | 6b 0d 2f 2f 0d 0d 53 54 |eam::See|k.//..ST|
|00000e40| 44 4d 45 54 48 4f 44 49 | 4d 50 0d 43 50 75 6c 6c |DMETHODI|MP.CPull|
|00000e50| 4f 6c 65 53 74 72 65 61 | 6d 4e 6f 74 69 66 79 3a |OleStrea|mNotify:|
|00000e60| 3a 53 65 65 6b 28 4c 41 | 52 47 45 5f 49 4e 54 45 |:Seek(LA|RGE_INTE|
|00000e70| 47 45 52 20 64 6c 69 62 | 4d 6f 76 65 2c 20 44 57 |GER dlib|Move, DW|
|00000e80| 4f 52 44 20 64 77 4f 72 | 69 67 69 6e 2c 0d 20 20 |ORD dwOr|igin,. |
|00000e90| 20 20 55 4c 41 52 47 45 | 5f 49 4e 54 45 47 45 52 | ULARGE|_INTEGER|
|00000ea0| 20 2a 70 6c 69 62 4e 65 | 77 50 6f 73 69 74 69 6f | *plibNe|wPositio|
|00000eb0| 6e 29 0d 7b 0d 23 70 72 | 61 67 6d 61 20 75 6e 75 |n).{.#pr|agma unu|
|00000ec0| 73 65 64 20 28 64 6c 69 | 62 4d 6f 76 65 2c 20 64 |sed (dli|bMove, d|
|00000ed0| 77 4f 72 69 67 69 6e 2c | 20 70 6c 69 62 4e 65 77 |wOrigin,| plibNew|
|00000ee0| 50 6f 73 69 74 69 6f 6e | 29 0d 20 20 20 20 72 65 |Position|). re|
|00000ef0| 74 75 72 6e 20 52 65 73 | 75 6c 74 46 72 6f 6d 53 |turn Res|ultFromS|
|00000f00| 63 6f 64 65 28 53 54 47 | 5f 45 5f 49 4e 56 41 4c |code(STG|_E_INVAL|
|00000f10| 49 44 46 55 4e 43 54 49 | 4f 4e 29 3b 0d 7d 0d 0d |IDFUNCTI|ON);.}..|
|00000f20| 2f 2f 0d 2f 2f 20 20 43 | 50 75 6c 6c 4f 6c 65 53 |//.// C|PullOleS|
|00000f30| 74 72 65 61 6d 4e 6f 74 | 69 66 79 3a 3a 49 53 74 |treamNot|ify::ISt|
|00000f40| 72 65 61 6d 3a 3a 53 65 | 74 53 69 7a 65 0d 2f 2f |ream::Se|tSize.//|
|00000f50| 0d 0d 53 54 44 4d 45 54 | 48 4f 44 49 4d 50 0d 43 |..STDMET|HODIMP.C|
|00000f60| 50 75 6c 6c 4f 6c 65 53 | 74 72 65 61 6d 4e 6f 74 |PullOleS|treamNot|
|00000f70| 69 66 79 3a 3a 53 65 74 | 53 69 7a 65 28 55 4c 41 |ify::Set|Size(ULA|
|00000f80| 52 47 45 5f 49 4e 54 45 | 47 45 52 20 6c 69 62 4e |RGE_INTE|GER libN|
|00000f90| 65 77 53 69 7a 65 29 0d | 7b 0d 23 70 72 61 67 6d |ewSize).|{.#pragm|
|00000fa0| 61 20 75 6e 75 73 65 64 | 20 28 6c 69 62 4e 65 77 |a unused| (libNew|
|00000fb0| 53 69 7a 65 29 0d 20 20 | 20 20 2f 2f 20 20 57 65 |Size). | // We|
|00000fc0| 27 72 65 20 61 20 72 65 | 61 64 2d 6f 6e 6c 79 20 |'re a re|ad-only |
|00000fd0| 73 74 72 65 61 6d 2c 20 | 73 6f 20 74 68 65 72 65 |stream, |so there|
|00000fe0| 27 73 20 6e 6f 20 72 65 | 61 73 6f 6e 20 74 6f 20 |'s no re|ason to |
|00000ff0| 72 65 73 69 7a 65 20 6f | 75 72 20 73 74 72 65 61 |resize o|ur strea|
|00001000| 6d 2e 0d 20 20 20 20 72 | 65 74 75 72 6e 20 52 65 |m.. r|eturn Re|
|00001010| 73 75 6c 74 46 72 6f 6d | 53 63 6f 64 65 28 53 54 |sultFrom|Scode(ST|
|00001020| 47 5f 45 5f 49 4e 56 41 | 4c 49 44 46 55 4e 43 54 |G_E_INVA|LIDFUNCT|
|00001030| 49 4f 4e 29 3b 0d 7d 0d | 0d 2f 2f 0d 2f 2f 20 20 |ION);.}.|.//.// |
|00001040| 43 50 75 6c 6c 4f 6c 65 | 53 74 72 65 61 6d 4e 6f |CPullOle|StreamNo|
|00001050| 74 69 66 79 3a 3a 49 53 | 74 72 65 61 6d 3a 3a 43 |tify::IS|tream::C|
|00001060| 6f 70 79 54 6f 0d 2f 2f | 0d 0d 53 54 44 4d 45 54 |opyTo.//|..STDMET|
|00001070| 48 4f 44 49 4d 50 0d 43 | 50 75 6c 6c 4f 6c 65 53 |HODIMP.C|PullOleS|
|00001080| 74 72 65 61 6d 4e 6f 74 | 69 66 79 3a 3a 43 6f 70 |treamNot|ify::Cop|
|00001090| 79 54 6f 28 4c 50 53 54 | 52 45 41 4d 20 70 73 74 |yTo(LPST|REAM pst|
|000010a0| 6d 2c 20 55 4c 41 52 47 | 45 5f 49 4e 54 45 47 45 |m, ULARG|E_INTEGE|
|000010b0| 52 20 63 62 2c 20 55 4c | 41 52 47 45 5f 49 4e 54 |R cb, UL|ARGE_INT|
|000010c0| 45 47 45 52 0d 20 20 20 | 20 2a 70 63 62 52 65 61 |EGER. | *pcbRea|
|000010d0| 64 2c 20 55 4c 41 52 47 | 45 5f 49 4e 54 45 47 45 |d, ULARG|E_INTEGE|
|000010e0| 52 20 2a 70 63 62 57 72 | 69 74 74 65 6e 29 0d 7b |R *pcbWr|itten).{|
|000010f0| 0d 23 70 72 61 67 6d 61 | 20 75 6e 75 73 65 64 20 |.#pragma| unused |
|00001100| 28 70 73 74 6d 2c 20 63 | 62 2c 20 70 63 62 52 65 |(pstm, c|b, pcbRe|
|00001110| 61 64 2c 20 70 63 62 57 | 72 69 74 74 65 6e 29 0d |ad, pcbW|ritten).|
|00001120| 20 20 20 20 2f 2f 20 20 | 54 68 65 72 65 27 73 20 | // |There's |
|00001130| 6e 6f 20 67 6f 6f 64 20 | 72 65 61 73 6f 6e 20 66 |no good |reason f|
|00001140| 6f 72 20 74 68 69 73 20 | 6e 6f 74 20 74 6f 20 62 |or this |not to b|
|00001150| 65 20 69 6d 70 6c 65 6d | 65 6e 74 65 64 2e 0d 20 |e implem|ented.. |
|00001160| 20 20 20 72 65 74 75 72 | 6e 20 52 65 73 75 6c 74 | retur|n Result|
|00001170| 46 72 6f 6d 53 63 6f 64 | 65 28 45 5f 4e 4f 54 49 |FromScod|e(E_NOTI|
|00001180| 4d 50 4c 29 3b 0d 7d 0d | 0d 2f 2f 0d 2f 2f 20 20 |MPL);.}.|.//.// |
|00001190| 43 50 75 6c 6c 4f 6c 65 | 53 74 72 65 61 6d 4e 6f |CPullOle|StreamNo|
|000011a0| 74 69 66 79 3a 3a 49 53 | 74 72 65 61 6d 3a 3a 43 |tify::IS|tream::C|
|000011b0| 6f 6d 6d 69 74 0d 2f 2f | 0d 0d 53 54 44 4d 45 54 |ommit.//|..STDMET|
|000011c0| 48 4f 44 49 4d 50 0d 43 | 50 75 6c 6c 4f 6c 65 53 |HODIMP.C|PullOleS|
|000011d0| 74 72 65 61 6d 4e 6f 74 | 69 66 79 3a 3a 43 6f 6d |treamNot|ify::Com|
|000011e0| 6d 69 74 28 44 57 4f 52 | 44 20 67 72 66 43 6f 6d |mit(DWOR|D grfCom|
|000011f0| 6d 69 74 46 6c 61 67 73 | 29 0d 7b 0d 23 70 72 61 |mitFlags|).{.#pra|
|00001200| 67 6d 61 20 75 6e 75 73 | 65 64 20 28 67 72 66 43 |gma unus|ed (grfC|
|00001210| 6f 6d 6d 69 74 46 6c 61 | 67 73 29 0d 20 20 20 20 |ommitFla|gs). |
|00001220| 2f 2f 20 20 57 65 20 63 | 61 6e 20 61 6c 77 61 79 |// We c|an alway|
|00001230| 73 20 22 63 6f 6d 6d 69 | 74 22 20 62 65 63 61 75 |s "commi|t" becau|
|00001240| 73 65 20 69 74 27 73 20 | 6e 6f 74 20 70 6f 73 73 |se it's |not poss|
|00001250| 69 62 6c 65 20 74 6f 20 | 77 72 69 74 65 20 74 6f |ible to |write to|
|00001260| 20 74 68 65 20 73 74 72 | 65 61 6d 2e 0d 20 20 20 | the str|eam.. |
|00001270| 20 72 65 74 75 72 6e 20 | 52 65 73 75 6c 74 46 72 | return |ResultFr|
|00001280| 6f 6d 53 63 6f 64 65 28 | 53 5f 4f 4b 29 3b 0d 7d |omScode(|S_OK);.}|
|00001290| 0d 0d 2f 2f 0d 2f 2f 20 | 20 43 50 75 6c 6c 4f 6c |..//.// | CPullOl|
|000012a0| 65 53 74 72 65 61 6d 4e | 6f 74 69 66 79 3a 3a 49 |eStreamN|otify::I|
|000012b0| 53 74 72 65 61 6d 3a 3a | 52 65 76 65 72 74 0d 2f |Stream::|Revert./|
|000012c0| 2f 0d 0d 53 54 44 4d 45 | 54 48 4f 44 49 4d 50 0d |/..STDME|THODIMP.|
|000012d0| 43 50 75 6c 6c 4f 6c 65 | 53 74 72 65 61 6d 4e 6f |CPullOle|StreamNo|
|000012e0| 74 69 66 79 3a 3a 52 65 | 76 65 72 74 28 76 6f 69 |tify::Re|vert(voi|
|000012f0| 64 29 0d 7b 0d 20 20 20 | 20 2f 2f 20 20 57 65 20 |d).{. | // We |
|00001300| 63 61 6e 20 61 6c 77 61 | 79 73 20 22 72 65 76 65 |can alwa|ys "reve|
|00001310| 72 74 22 20 62 65 63 61 | 75 73 65 20 69 74 27 73 |rt" beca|use it's|
|00001320| 20 6e 6f 74 20 70 6f 73 | 73 69 62 6c 65 20 74 6f | not pos|sible to|
|00001330| 20 77 72 69 74 65 20 74 | 6f 20 74 68 65 20 73 74 | write t|o the st|
|00001340| 72 65 61 6d 2e 0d 20 20 | 20 20 72 65 74 75 72 6e |ream.. | return|
|00001350| 20 52 65 73 75 6c 74 46 | 72 6f 6d 53 63 6f 64 65 | ResultF|romScode|
|00001360| 28 53 5f 4f 4b 29 3b 0d | 7d 0d 0d 2f 2f 0d 2f 2f |(S_OK);.|}..//.//|
|00001370| 20 20 43 50 75 6c 6c 4f | 6c 65 53 74 72 65 61 6d | CPullO|leStream|
|00001380| 4e 6f 74 69 66 79 3a 3a | 49 53 74 72 65 61 6d 3a |Notify::|IStream:|
|00001390| 3a 4c 6f 63 6b 52 65 67 | 69 6f 6e 0d 2f 2f 0d 0d |:LockReg|ion.//..|
|000013a0| 53 54 44 4d 45 54 48 4f | 44 49 4d 50 0d 43 50 75 |STDMETHO|DIMP.CPu|
|000013b0| 6c 6c 4f 6c 65 53 74 72 | 65 61 6d 4e 6f 74 69 66 |llOleStr|eamNotif|
|000013c0| 79 3a 3a 4c 6f 63 6b 52 | 65 67 69 6f 6e 28 55 4c |y::LockR|egion(UL|
|000013d0| 41 52 47 45 5f 49 4e 54 | 45 47 45 52 20 6c 69 62 |ARGE_INT|EGER lib|
|000013e0| 4f 66 66 73 65 74 2c 20 | 55 4c 41 52 47 45 5f 49 |Offset, |ULARGE_I|
|000013f0| 4e 54 45 47 45 52 20 63 | 62 2c 0d 20 20 20 20 44 |NTEGER c|b,. D|
|00001400| 57 4f 52 44 20 64 77 4c | 6f 63 6b 54 79 70 65 29 |WORD dwL|ockType)|
|00001410| 0d 7b 0d 23 70 72 61 67 | 6d 61 20 75 6e 75 73 65 |.{.#prag|ma unuse|
|00001420| 64 20 28 6c 69 62 4f 66 | 66 73 65 74 2c 20 63 62 |d (libOf|fset, cb|
|00001430| 2c 20 64 77 4c 6f 63 6b | 54 79 70 65 29 0d 20 20 |, dwLock|Type). |
|00001440| 20 20 72 65 74 75 72 6e | 20 52 65 73 75 6c 74 46 | return| ResultF|
|00001450| 72 6f 6d 53 63 6f 64 65 | 28 53 54 47 5f 45 5f 49 |romScode|(STG_E_I|
|00001460| 4e 56 41 4c 49 44 46 55 | 4e 43 54 49 4f 4e 29 3b |NVALIDFU|NCTION);|
|00001470| 0d 7d 0d 0d 2f 2f 0d 2f | 2f 20 20 43 50 75 6c 6c |.}..//./|/ CPull|
|00001480| 4f 6c 65 53 74 72 65 61 | 6d 4e 6f 74 69 66 79 3a |OleStrea|mNotify:|
|00001490| 3a 49 53 74 72 65 61 6d | 3a 3a 55 6e 6c 6f 63 6b |:IStream|::Unlock|
|000014a0| 52 65 67 69 6f 6e 0d 2f | 2f 0d 0d 53 54 44 4d 45 |Region./|/..STDME|
|000014b0| 54 48 4f 44 49 4d 50 0d | 43 50 75 6c 6c 4f 6c 65 |THODIMP.|CPullOle|
|000014c0| 53 74 72 65 61 6d 4e 6f | 74 69 66 79 3a 3a 55 6e |StreamNo|tify::Un|
|000014d0| 6c 6f 63 6b 52 65 67 69 | 6f 6e 28 55 4c 41 52 47 |lockRegi|on(ULARG|
|000014e0| 45 5f 49 4e 54 45 47 45 | 52 20 6c 69 62 4f 66 66 |E_INTEGE|R libOff|
|000014f0| 73 65 74 2c 20 55 4c 41 | 52 47 45 5f 49 4e 54 45 |set, ULA|RGE_INTE|
|00001500| 47 45 52 0d 20 20 20 20 | 63 62 2c 20 44 57 4f 52 |GER. |cb, DWOR|
|00001510| 44 20 64 77 4c 6f 63 6b | 54 79 70 65 29 0d 7b 0d |D dwLock|Type).{.|
|00001520| 23 70 72 61 67 6d 61 20 | 75 6e 75 73 65 64 20 28 |#pragma |unused (|
|00001530| 6c 69 62 4f 66 66 73 65 | 74 2c 20 63 62 2c 20 64 |libOffse|t, cb, d|
|00001540| 77 4c 6f 63 6b 54 79 70 | 65 29 0d 20 20 20 20 72 |wLockTyp|e). r|
|00001550| 65 74 75 72 6e 20 52 65 | 73 75 6c 74 46 72 6f 6d |eturn Re|sultFrom|
|00001560| 53 63 6f 64 65 28 53 54 | 47 5f 45 5f 49 4e 56 41 |Scode(ST|G_E_INVA|
|00001570| 4c 49 44 46 55 4e 43 54 | 49 4f 4e 29 3b 0d 7d 0d |LIDFUNCT|ION);.}.|
|00001580| 0d 2f 2f 0d 2f 2f 20 20 | 43 50 75 6c 6c 4f 6c 65 |.//.// |CPullOle|
|00001590| 53 74 72 65 61 6d 4e 6f | 74 69 66 79 3a 3a 49 53 |StreamNo|tify::IS|
|000015a0| 74 72 65 61 6d 3a 3a 53 | 74 61 74 0d 2f 2f 0d 0d |tream::S|tat.//..|
|000015b0| 53 54 44 4d 45 54 48 4f | 44 49 4d 50 0d 43 50 75 |STDMETHO|DIMP.CPu|
|000015c0| 6c 6c 4f 6c 65 53 74 72 | 65 61 6d 4e 6f 74 69 66 |llOleStr|eamNotif|
|000015d0| 79 3a 3a 53 74 61 74 28 | 53 54 41 54 53 54 47 20 |y::Stat(|STATSTG |
|000015e0| 2a 70 73 74 61 74 73 74 | 67 2c 20 44 57 4f 52 44 |*pstatst|g, DWORD|
|000015f0| 20 67 72 66 53 74 61 74 | 46 6c 61 67 29 0d 7b 0d | grfStat|Flag).{.|
|00001600| 23 70 72 61 67 6d 61 20 | 75 6e 75 73 65 64 20 28 |#pragma |unused (|
|00001610| 67 72 66 53 74 61 74 46 | 6c 61 67 29 0d 20 20 20 |grfStatF|lag). |
|00001620| 20 2f 2f 20 20 49 6d 70 | 6c 65 6d 65 6e 74 61 74 | // Imp|lementat|
|00001630| 69 6f 6e 20 6c 69 66 74 | 65 64 20 66 72 6f 6d 20 |ion lift|ed from |
|00001640| 4f 4c 45 33 32 27 73 20 | 6d 65 6d 6f 72 79 20 73 |OLE32's |memory s|
|00001650| 74 72 65 61 6d 2e 0d 20 | 20 20 20 6d 65 6d 73 65 |tream.. | memse|
|00001660| 74 28 70 73 74 61 74 73 | 74 67 2c 20 30 2c 20 73 |t(pstats|tg, 0, s|
|00001670| 69 7a 65 6f 66 28 2a 70 | 73 74 61 74 73 74 67 29 |izeof(*p|statstg)|
|00001680| 29 3b 0d 20 20 20 20 70 | 73 74 61 74 73 74 67 2d |);. p|statstg-|
|00001690| 3e 74 79 70 65 20 3d 20 | 53 54 47 54 59 5f 53 54 |>type = |STGTY_ST|
|000016a0| 52 45 41 4d 3b 0d 20 20 | 20 20 70 73 74 61 74 73 |REAM;. | pstats|
|000016b0| 74 67 2d 3e 63 62 53 69 | 7a 65 2e 4c 6f 77 50 61 |tg->cbSi|ze.LowPa|
|000016c0| 72 74 20 3d 20 6d 5f 53 | 74 72 65 61 6d 4c 65 6e |rt = m_S|treamLen|
|000016d0| 67 74 68 3b 0d 20 20 20 | 20 72 65 74 75 72 6e 20 |gth;. | return |
|000016e0| 52 65 73 75 6c 74 46 72 | 6f 6d 53 63 6f 64 65 28 |ResultFr|omScode(|
|000016f0| 53 5f 4f 4b 29 3b 0d 7d | 0d 0d 2f 2f 0d 2f 2f 20 |S_OK);.}|..//.// |
|00001700| 20 43 50 75 6c 6c 4f 6c | 65 53 74 72 65 61 6d 4e | CPullOl|eStreamN|
|00001710| 6f 74 69 66 79 3a 3a 49 | 53 74 72 65 61 6d 3a 3a |otify::I|Stream::|
|00001720| 43 6c 6f 6e 65 0d 2f 2f | 0d 0d 53 54 44 4d 45 54 |Clone.//|..STDMET|
|00001730| 48 4f 44 49 4d 50 0d 43 | 50 75 6c 6c 4f 6c 65 53 |HODIMP.C|PullOleS|
|00001740| 74 72 65 61 6d 4e 6f 74 | 69 66 79 3a 3a 43 6c 6f |treamNot|ify::Clo|
|00001750| 6e 65 28 4c 50 53 54 52 | 45 41 4d 20 2a 70 70 73 |ne(LPSTR|EAM *pps|
|00001760| 74 6d 29 0d 7b 0d 20 20 | 20 20 2a 70 70 73 74 6d |tm).{. | *ppstm|
|00001770| 20 3d 20 4e 55 4c 4c 3b | 0d 20 20 20 20 72 65 74 | = NULL;|. ret|
|00001780| 75 72 6e 20 52 65 73 75 | 6c 74 46 72 6f 6d 53 63 |urn Resu|ltFromSc|
|00001790| 6f 64 65 28 45 5f 4e 4f | 54 49 4d 50 4c 29 3b 0d |ode(E_NO|TIMPL);.|
|000017a0| 7d 0d 0d 2f 2f 0d 2f 2f | 20 20 43 42 69 6e 64 69 |}..//.//| CBindi|
|000017b0| 6e 67 4d 65 6d 6f 72 79 | 53 74 72 65 61 6d 4e 6f |ngMemory|StreamNo|
|000017c0| 74 69 66 79 3a 3a 4f 6e | 57 72 69 74 65 0d 2f 2f |tify::On|Write.//|
|000017d0| 0d 2f 2f 20 20 45 78 74 | 65 6e 64 73 20 74 68 65 |.// Ext|ends the|
|000017e0| 20 64 65 66 61 75 6c 74 | 20 6d 65 6d 6f 72 79 20 | default| memory |
|000017f0| 73 74 72 65 61 6d 20 69 | 6d 70 6c 65 6d 65 6e 74 |stream i|mplement|
|00001800| 61 74 69 6f 6e 20 62 79 | 20 6e 6f 74 69 66 79 69 |ation by| notifyi|
|00001810| 6e 67 20 74 68 65 20 63 | 6c 69 65 6e 74 20 6f 66 |ng the c|lient of|
|00001820| 0d 2f 2f 20 20 64 61 74 | 61 20 61 76 61 69 6c 61 |.// dat|a availa|
|00001830| 62 69 6c 69 74 79 2e 0d | 2f 2f 0d 0d 69 6e 74 33 |bility..|//..int3|
|00001840| 32 0d 43 42 69 6e 64 69 | 6e 67 50 75 6c 6c 53 74 |2.CBindi|ngPullSt|
|00001850| 72 65 61 6d 4e 6f 74 69 | 66 79 3a 3a 4f 6e 57 72 |reamNoti|fy::OnWr|
|00001860| 69 74 65 28 4e 50 53 74 | 72 65 61 6d 20 2a 73 74 |ite(NPSt|ream *st|
|00001870| 72 65 61 6d 2c 20 69 6e | 74 33 32 20 6f 66 66 73 |ream, in|t32 offs|
|00001880| 65 74 2c 20 69 6e 74 33 | 32 20 6c 65 6e 2c 0d 20 |et, int3|2 len,. |
|00001890| 20 20 20 76 6f 69 64 20 | 2a 62 75 66 66 65 72 29 | void |*buffer)|
|000018a0| 0d 7b 0d 20 20 20 20 69 | 6e 74 33 32 20 42 79 74 |.{. i|nt32 Byt|
|000018b0| 65 73 57 72 69 74 74 65 | 6e 3b 0d 20 20 20 20 55 |esWritte|n;. U|
|000018c0| 4c 4f 4e 47 20 42 69 6e | 64 53 74 61 74 75 73 3b |LONG Bin|dStatus;|
|000018d0| 0d 20 20 20 20 44 57 4f | 52 44 20 66 42 53 43 46 |. DWO|RD fBSCF|
|000018e0| 3b 0d 0d 20 20 20 20 2f | 2f 20 20 54 61 67 20 74 |;.. /|/ Tag t|
|000018f0| 68 65 20 73 74 72 65 61 | 6d 20 73 75 63 68 20 74 |he strea|m such t|
|00001900| 68 61 74 20 72 65 71 75 | 65 73 74 73 20 66 6f 72 |hat requ|ests for|
|00001910| 20 75 6e 61 76 61 69 6c | 61 62 6c 65 20 64 61 74 | unavail|able dat|
|00001920| 61 20 6d 61 64 65 20 61 | 67 61 69 6e 73 74 20 6f |a made a|gainst o|
|00001930| 75 72 0d 20 20 20 20 2f | 2f 20 20 49 53 74 72 65 |ur. /|/ IStre|
|00001940| 61 6d 20 72 65 74 75 72 | 6e 20 45 5f 50 45 4e 44 |am retur|n E_PEND|
|00001950| 49 4e 47 2e 0d 20 20 20 | 20 6d 5f 66 41 73 79 6e |ING.. | m_fAsyn|
|00001960| 63 53 74 72 65 61 6d 49 | 6e 50 72 6f 67 72 65 73 |cStreamI|nProgres|
|00001970| 73 20 3d 20 54 52 55 45 | 3b 0d 0d 20 20 20 20 42 |s = TRUE|;.. B|
|00001980| 79 74 65 73 57 72 69 74 | 74 65 6e 20 3d 20 43 50 |ytesWrit|ten = CP|
|00001990| 75 6c 6c 4f 6c 65 53 74 | 72 65 61 6d 4e 6f 74 69 |ullOleSt|reamNoti|
|000019a0| 66 79 3a 3a 4f 6e 57 72 | 69 74 65 28 73 74 72 65 |fy::OnWr|ite(stre|
|000019b0| 61 6d 2c 20 6f 66 66 73 | 65 74 2c 20 6c 65 6e 2c |am, offs|et, len,|
|000019c0| 20 62 75 66 66 65 72 29 | 3b 0d 0d 20 20 20 20 69 | buffer)|;.. i|
|000019d0| 66 20 28 42 79 74 65 73 | 57 72 69 74 74 65 6e 20 |f (Bytes|Written |
|000019e0| 3e 20 30 29 20 7b 0d 0d | 20 20 20 20 20 20 20 20 |> 0) {..| |
|000019f0| 69 66 20 28 21 6d 5f 66 | 44 65 6c 69 76 65 72 65 |if (!m_f|Delivere|
|00001a00| 64 46 69 72 73 74 4e 6f | 74 69 66 79 29 20 7b 0d |dFirstNo|tify) {.|
|00001a10| 20 20 20 20 20 20 20 20 | 20 20 20 20 6d 5f 66 44 | | m_fD|
|00001a20| 65 6c 69 76 65 72 65 64 | 46 69 72 73 74 4e 6f 74 |elivered|FirstNot|
|00001a30| 69 66 79 20 3d 20 54 52 | 55 45 3b 0d 20 20 20 20 |ify = TR|UE;. |
|00001a40| 20 20 20 20 20 20 20 20 | 42 69 6e 64 53 74 61 74 | |BindStat|
|00001a50| 75 73 20 3d 20 42 49 4e | 44 53 54 41 54 55 53 5f |us = BIN|DSTATUS_|
|00001a60| 42 45 47 49 4e 44 4f 57 | 4e 4c 4f 41 44 44 41 54 |BEGINDOW|NLOADDAT|
|00001a70| 41 3b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 66 |A;. | f|
|00001a80| 42 53 43 46 20 3d 20 42 | 53 43 46 5f 46 49 52 53 |BSCF = B|SCF_FIRS|
|00001a90| 54 44 41 54 41 4e 4f 54 | 49 46 49 43 41 54 49 4f |TDATANOT|IFICATIO|
|00001aa0| 4e 3b 0d 20 20 20 20 20 | 20 20 20 7d 20 65 6c 73 |N;. | } els|
|00001ab0| 65 20 7b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |e {. | |
|00001ac0| 42 69 6e 64 53 74 61 74 | 75 73 20 3d 20 42 49 4e |BindStat|us = BIN|
|00001ad0| 44 53 54 41 54 55 53 5f | 44 4f 57 4e 4c 4f 41 44 |DSTATUS_|DOWNLOAD|
|00001ae0| 49 4e 47 44 41 54 41 3b | 0d 20 20 20 20 20 20 20 |INGDATA;|. |
|00001af0| 20 20 20 20 20 66 42 53 | 43 46 20 3d 20 42 53 43 | fBS|CF = BSC|
|00001b00| 46 5f 49 4e 54 45 52 4d | 45 44 49 41 54 45 44 41 |F_INTERM|EDIATEDA|
|00001b10| 54 41 4e 4f 54 49 46 49 | 43 41 54 49 4f 4e 3b 0d |TANOTIFI|CATION;.|
|00001b20| 20 20 20 20 20 20 20 20 | 7d 0d 0d 20 20 20 20 20 | |}.. |
|00001b30| 20 20 20 6d 5f 70 42 69 | 6e 64 69 6e 67 2d 3e 6d | m_pBi|nding->m|
|00001b40| 5f 70 62 73 63 2d 3e 4f | 6e 50 72 6f 67 72 65 73 |_pbsc->O|nProgres|
|00001b50| 73 28 28 55 4c 4f 4e 47 | 29 20 6d 5f 53 74 72 65 |s((ULONG|) m_Stre|
|00001b60| 61 6d 4c 65 6e 67 74 68 | 2c 20 0d 20 20 20 20 20 |amLength|, . |
|00001b70| 20 20 20 20 20 20 20 28 | 55 4c 4f 4e 47 29 20 6d | (|ULONG) m|
|00001b80| 5f 53 74 72 65 61 6d 4c | 65 6e 67 74 68 2c 20 42 |_StreamL|ength, B|
|00001b90| 69 6e 64 53 74 61 74 75 | 73 2c 20 6d 5f 70 73 7a |indStatu|s, m_psz|
|00001ba0| 55 52 4c 29 3b 0d 0d 20 | 20 20 20 20 20 20 20 6d |URL);.. | m|
|00001bb0| 53 74 6f 72 61 67 65 4d | 65 64 69 75 6d 2e 74 79 |StorageM|edium.ty|
|00001bc0| 6d 65 64 20 3d 20 54 59 | 4d 45 44 5f 49 53 54 52 |med = TY|MED_ISTR|
|00001bd0| 45 41 4d 3b 0d 20 20 20 | 20 20 20 20 20 6d 53 74 |EAM;. | mSt|
|00001be0| 6f 72 61 67 65 4d 65 64 | 69 75 6d 2e 75 2e 70 73 |orageMed|ium.u.ps|
|00001bf0| 74 6d 20 3d 20 28 4c 50 | 53 54 52 45 41 4d 29 20 |tm = (LP|STREAM) |
|00001c00| 74 68 69 73 3b 0d 20 20 | 20 20 20 20 20 20 6d 53 |this;. | mS|
|00001c10| 74 6f 72 61 67 65 4d 65 | 64 69 75 6d 2e 70 55 6e |torageMe|dium.pUn|
|00001c20| 6b 46 6f 72 52 65 6c 65 | 61 73 65 20 3d 20 28 4c |kForRele|ase = (L|
|00001c30| 50 55 4e 4b 4e 4f 57 4e | 29 20 74 68 69 73 3b 0d |PUNKNOWN|) this;.|
|00001c40| 20 20 20 20 20 20 20 20 | 6d 5f 70 42 69 6e 64 69 | |m_pBindi|
|00001c50| 6e 67 2d 3e 6d 5f 70 62 | 73 63 2d 3e 4f 6e 44 61 |ng->m_pb|sc->OnDa|
|00001c60| 74 61 41 76 61 69 6c 61 | 62 6c 65 28 66 42 53 43 |taAvaila|ble(fBSC|
|00001c70| 46 2c 20 42 79 74 65 73 | 57 72 69 74 74 65 6e 2c |F, Bytes|Written,|
|00001c80| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 26 67 5f |. | &g_|
|00001c90| 4e 75 6c 6c 46 6f 72 6d | 61 74 45 74 63 2c 20 26 |NullForm|atEtc, &|
|00001ca0| 6d 53 74 6f 72 61 67 65 | 4d 65 64 69 75 6d 29 3b |mStorage|Medium);|
|00001cb0| 0d 0d 20 20 20 20 20 20 | 20 20 2f 2f 20 20 49 66 |.. | // If|
|00001cc0| 20 74 68 65 20 63 6c 69 | 65 6e 74 20 63 61 6c 6c | the cli|ent call|
|00001cd0| 65 64 20 49 42 69 6e 64 | 69 6e 67 3a 3a 41 62 6f |ed IBind|ing::Abo|
|00001ce0| 72 74 2c 20 72 65 74 75 | 72 6e 20 61 6e 20 65 72 |rt, retu|rn an er|
|00001cf0| 72 6f 72 20 73 6f 20 61 | 73 20 74 6f 0d 20 20 20 |ror so a|s to. |
|00001d00| 20 20 20 20 20 2f 2f 20 | 20 66 6f 72 63 65 20 74 | // | force t|
|00001d10| 68 65 20 73 74 72 65 61 | 6d 20 74 6f 20 74 65 72 |he strea|m to ter|
|00001d20| 6d 69 6e 61 74 65 2e 0d | 20 20 20 20 20 20 20 20 |minate..| |
|00001d30| 69 66 20 28 6d 5f 70 42 | 69 6e 64 69 6e 67 2d 3e |if (m_pB|inding->|
|00001d40| 6d 5f 66 41 62 6f 72 74 | 65 64 29 0d 20 20 20 20 |m_fAbort|ed). |
|00001d50| 20 20 20 20 20 20 20 20 | 42 79 74 65 73 57 72 69 | |BytesWri|
|00001d60| 74 74 65 6e 20 3d 20 2d | 31 3b 0d 20 20 20 20 7d |tten = -|1;. }|
|00001d70| 0d 0d 20 20 20 20 2f 2f | 20 20 49 66 20 42 79 74 |.. //| If Byt|
|00001d80| 65 73 57 72 69 74 74 65 | 6e 20 69 73 20 6e 65 67 |esWritte|n is neg|
|00001d90| 61 74 69 76 65 2c 20 74 | 68 65 6e 20 74 68 65 20 |ative, t|hen the |
|00001da0| 73 74 72 65 61 6d 20 77 | 69 6c 6c 20 62 65 20 74 |stream w|ill be t|
|00001db0| 65 72 6d 69 6e 61 74 65 | 64 2e 20 20 54 68 65 0d |erminate|d. The.|
|00001dc0| 20 20 20 20 2f 2f 20 20 | 63 6c 69 65 6e 74 20 77 | // |client w|
|00001dd0| 69 6c 6c 20 62 65 20 6e | 6f 74 69 66 69 65 64 20 |ill be n|otified |
|00001de0| 6f 66 20 74 68 65 20 65 | 72 72 6f 72 20 69 6e 20 |of the e|rror in |
|00001df0| 74 68 65 20 4f 6e 44 65 | 73 74 72 6f 79 53 74 72 |the OnDe|stroyStr|
|00001e00| 65 61 6d 20 6d 65 74 68 | 6f 64 2e 0d 20 20 20 20 |eam meth|od.. |
|00001e10| 72 65 74 75 72 6e 20 42 | 79 74 65 73 57 72 69 74 |return B|ytesWrit|
|00001e20| 74 65 6e 3b 0d 7d 0d 0d | 2f 2f 0d 2f 2f 20 20 43 |ten;.}..|//.// C|
|00001e30| 42 69 6e 64 69 6e 67 4d | 65 6d 6f 72 79 53 74 72 |BindingM|emoryStr|
|00001e40| 65 61 6d 4e 6f 74 69 66 | 79 3a 3a 4f 6e 44 65 73 |eamNotif|y::OnDes|
|00001e50| 74 72 6f 79 53 74 72 65 | 61 6d 0d 2f 2f 0d 2f 2f |troyStre|am.//.//|
|00001e60| 20 20 45 78 74 65 6e 64 | 73 20 74 68 65 20 64 65 | Extend|s the de|
|00001e70| 66 61 75 6c 74 20 6d 65 | 6d 6f 72 79 20 73 74 72 |fault me|mory str|
|00001e80| 65 61 6d 20 69 6d 70 6c | 65 6d 65 6e 74 61 74 69 |eam impl|ementati|
|00001e90| 6f 6e 20 62 79 20 6e 6f | 74 69 66 79 69 6e 67 20 |on by no|tifying |
|00001ea0| 74 68 65 20 63 6c 69 65 | 6e 74 0d 2f 2f 20 20 74 |the clie|nt.// t|
|00001eb0| 68 61 74 20 74 68 65 20 | 62 69 6e 64 69 6e 67 20 |hat the |binding |
|00001ec0| 6f 70 65 72 61 74 69 6f | 6e 20 69 73 20 63 6f 6d |operatio|n is com|
|00001ed0| 70 6c 65 74 65 2e 0d 2f | 2f 0d 0d 4e 50 45 72 72 |plete../|/..NPErr|
|00001ee0| 6f 72 0d 43 42 69 6e 64 | 69 6e 67 50 75 6c 6c 53 |or.CBind|ingPullS|
|00001ef0| 74 72 65 61 6d 4e 6f 74 | 69 66 79 3a 3a 4f 6e 44 |treamNot|ify::OnD|
|00001f00| 65 73 74 72 6f 79 53 74 | 72 65 61 6d 28 4e 50 53 |estroySt|ream(NPS|
|00001f10| 74 72 65 61 6d 20 2a 73 | 74 72 65 61 6d 2c 20 4e |tream *s|tream, N|
|00001f20| 50 45 72 72 6f 72 20 72 | 65 61 73 6f 6e 29 0d 7b |PError r|eason).{|
|00001f30| 0d 23 70 72 61 67 6d 61 | 20 75 6e 75 73 65 64 20 |.#pragma| unused |
|00001f40| 28 73 74 72 65 61 6d 29 | 0d 20 20 20 20 48 52 45 |(stream)|. HRE|
|00001f50| 53 55 4c 54 20 68 72 3b | 0d 0d 20 20 20 20 6d 5f |SULT hr;|.. m_|
|00001f60| 66 41 73 79 6e 63 53 74 | 72 65 61 6d 49 6e 50 72 |fAsyncSt|reamInPr|
|00001f70| 6f 67 72 65 73 73 20 3d | 20 46 41 4c 53 45 3b 0d |ogress =| FALSE;.|
|00001f80| 0d 20 20 20 20 2f 2f 20 | 20 59 6f 75 20 77 6f 75 |. // | You wou|
|00001f90| 6c 64 20 74 68 69 6e 6b | 20 4e 65 74 73 63 61 70 |ld think| Netscap|
|00001fa0| 65 20 77 6f 75 6c 64 20 | 70 61 73 73 20 74 68 65 |e would |pass the|
|00001fb0| 20 72 69 67 68 74 20 72 | 65 61 73 6f 6e 20 63 6f | right r|eason co|
|00001fc0| 64 65 20 74 6f 20 75 73 | 2c 20 62 75 74 20 69 74 |de to us|, but it|
|00001fd0| 0d 20 20 20 20 2f 2f 20 | 20 61 6c 77 61 79 73 20 |. // | always |
|00001fe0| 72 65 74 75 72 6e 73 20 | 61 20 7a 65 72 6f 20 6f |returns |a zero o|
|00001ff0| 6e 20 73 75 63 63 65 73 | 73 2c 20 73 6f 20 6d 61 |n succes|s, so ma|
|00002000| 79 62 65 20 74 68 65 79 | 20 77 61 6e 74 20 4e 50 |ybe they| want NP|
|00002010| 45 52 52 5f 4e 4f 5f 45 | 52 52 4f 52 3f 3f 3f 0d |ERR_NO_E|RROR???.|
|00002020| 20 20 20 20 69 66 20 28 | 28 72 65 61 73 6f 6e 20 | if (|(reason |
|00002030| 3d 3d 20 4e 50 45 52 52 | 5f 4e 4f 5f 45 52 52 4f |== NPERR|_NO_ERRO|
|00002040| 52 20 7c 7c 20 72 65 61 | 73 6f 6e 20 3d 3d 20 4e |R || rea|son == N|
|00002050| 50 52 45 53 5f 44 4f 4e | 45 29 20 26 26 0d 20 20 |PRES_DON|E) &&. |
|00002060| 20 20 20 20 20 20 21 6d | 5f 70 42 69 6e 64 69 6e | !m|_pBindin|
|00002070| 67 2d 3e 6d 5f 66 41 62 | 6f 72 74 65 64 29 20 7b |g->m_fAb|orted) {|
|00002080| 0d 20 20 20 20 20 20 20 | 20 2f 2f 20 20 53 65 6e |. | // Sen|
|00002090| 64 20 74 68 65 20 66 69 | 6e 61 6c 20 70 72 6f 67 |d the fi|nal prog|
|000020a0| 72 65 73 73 20 6e 6f 74 | 69 66 69 63 61 74 69 6f |ress not|ificatio|
|000020b0| 6e 2e 0d 20 20 20 20 20 | 20 20 20 6d 5f 70 42 69 |n.. | m_pBi|
|000020c0| 6e 64 69 6e 67 2d 3e 6d | 5f 70 62 73 63 2d 3e 4f |nding->m|_pbsc->O|
|000020d0| 6e 50 72 6f 67 72 65 73 | 73 28 28 55 4c 4f 4e 47 |nProgres|s((ULONG|
|000020e0| 29 20 6d 5f 53 74 72 65 | 61 6d 4c 65 6e 67 74 68 |) m_Stre|amLength|
|000020f0| 2c 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 28 55 |,. | (U|
|00002100| 4c 4f 4e 47 29 20 6d 5f | 53 74 72 65 61 6d 4c 65 |LONG) m_|StreamLe|
|00002110| 6e 67 74 68 2c 20 42 49 | 4e 44 53 54 41 54 55 53 |ngth, BI|NDSTATUS|
|00002120| 5f 45 4e 44 44 4f 57 4e | 4c 4f 41 44 44 41 54 41 |_ENDDOWN|LOADDATA|
|00002130| 2c 20 6d 5f 70 73 7a 55 | 52 4c 29 3b 0d 0d 20 20 |, m_pszU|RL);.. |
|00002140| 20 20 20 20 20 20 2f 2f | 20 20 41 6c 74 68 6f 75 | //| Althou|
|00002150| 67 68 20 74 68 65 20 64 | 61 74 61 20 73 74 72 65 |gh the d|ata stre|
|00002160| 61 6d 20 68 61 73 6e 27 | 74 20 63 68 61 6e 67 65 |am hasn'|t change|
|00002170| 64 2c 20 77 65 20 6e 65 | 65 64 20 74 6f 20 73 65 |d, we ne|ed to se|
|00002180| 6e 64 20 74 68 65 20 6c | 61 73 74 0d 20 20 20 20 |nd the l|ast. |
|00002190| 20 20 20 20 2f 2f 20 20 | 64 61 74 61 20 6e 6f 74 | // |data not|
|000021a0| 69 66 69 63 61 74 69 6f | 6e 2e 0d 20 20 20 20 20 |ificatio|n.. |
|000021b0| 20 20 20 6d 53 74 6f 72 | 61 67 65 4d 65 64 69 75 | mStor|ageMediu|
|000021c0| 6d 2e 74 79 6d 65 64 20 | 3d 20 54 59 4d 45 44 5f |m.tymed |= TYMED_|
|000021d0| 49 53 54 52 45 41 4d 3b | 0d 20 20 20 20 20 20 20 |ISTREAM;|. |
|000021e0| 20 6d 53 74 6f 72 61 67 | 65 4d 65 64 69 75 6d 2e | mStorag|eMedium.|
|000021f0| 75 2e 70 73 74 6d 20 3d | 20 28 4c 50 53 54 52 45 |u.pstm =| (LPSTRE|
|00002200| 41 4d 29 20 74 68 69 73 | 3b 0d 20 20 20 20 20 20 |AM) this|;. |
|00002210| 20 20 6d 53 74 6f 72 61 | 67 65 4d 65 64 69 75 6d | mStora|geMedium|
|00002220| 2e 70 55 6e 6b 46 6f 72 | 52 65 6c 65 61 73 65 20 |.pUnkFor|Release |
|00002230| 3d 20 28 4c 50 55 4e 4b | 4e 4f 57 4e 29 20 74 68 |= (LPUNK|NOWN) th|
|00002240| 69 73 3b 0d 20 20 20 20 | 20 20 20 20 6d 5f 70 42 |is;. | m_pB|
|00002250| 69 6e 64 69 6e 67 2d 3e | 6d 5f 70 62 73 63 2d 3e |inding->|m_pbsc->|
|00002260| 4f 6e 44 61 74 61 41 76 | 61 69 6c 61 62 6c 65 28 |OnDataAv|ailable(|
|00002270| 42 53 43 46 5f 4c 41 53 | 54 44 41 54 41 4e 4f 54 |BSCF_LAS|TDATANOT|
|00002280| 49 46 49 43 41 54 49 4f | 4e 2c 0d 20 20 20 20 20 |IFICATIO|N,. |
|00002290| 20 20 20 20 20 20 20 6d | 5f 53 74 72 65 61 6d 4c | m|_StreamL|
|000022a0| 65 6e 67 74 68 2c 20 26 | 67 5f 4e 75 6c 6c 46 6f |ength, &|g_NullFo|
|000022b0| 72 6d 61 74 45 74 63 2c | 20 26 6d 53 74 6f 72 61 |rmatEtc,| &mStora|
|000022c0| 67 65 4d 65 64 69 75 6d | 29 3b 0d 0d 20 20 20 20 |geMedium|);.. |
|000022d0| 20 20 20 20 68 72 20 3d | 20 52 65 73 75 6c 74 46 | hr =| ResultF|
|000022e0| 72 6f 6d 53 63 6f 64 65 | 28 53 5f 4f 4b 29 3b 0d |romScode|(S_OK);.|
|000022f0| 20 20 20 20 7d 20 65 6c | 73 65 20 7b 0d 20 20 20 | } el|se {. |
|00002300| 20 20 20 20 20 68 72 20 | 3d 20 52 65 73 75 6c 74 | hr |= Result|
|00002310| 46 72 6f 6d 53 63 6f 64 | 65 28 45 5f 41 42 4f 52 |FromScod|e(E_ABOR|
|00002320| 54 29 3b 0d 20 20 20 20 | 7d 0d 0d 20 20 20 20 2f |T);. |}.. /|
|00002330| 2f 20 20 4e 6f 74 69 66 | 79 20 74 68 65 20 63 61 |/ Notif|y the ca|
|00002340| 6c 6c 62 61 63 6b 20 74 | 68 61 74 20 74 68 65 20 |llback t|hat the |
|00002350| 62 69 6e 64 69 6e 67 20 | 68 61 73 20 73 74 6f 70 |binding |has stop|
|00002360| 70 65 64 2e 20 20 50 6c | 75 73 2c 20 77 65 27 72 |ped. Pl|us, we'r|
|00002370| 65 20 74 68 72 6f 75 67 | 68 0d 20 20 20 20 2f 2f |e throug|h. //|
|00002380| 20 20 77 69 74 68 20 74 | 68 65 20 62 69 6e 64 69 | with t|he bindi|
|00002390| 6e 67 20 6f 62 6a 65 63 | 74 2c 20 73 6f 20 77 65 |ng objec|t, so we|
|000023a0| 27 72 65 20 72 65 61 64 | 79 20 74 6f 20 74 68 72 |'re read|y to thr|
|000023b0| 6f 77 20 69 74 20 61 77 | 61 79 2e 20 20 54 68 65 |ow it aw|ay. The|
|000023c0| 20 63 6c 69 65 6e 74 0d | 20 20 20 20 2f 2f 20 20 | client.| // |
|000023d0| 69 73 20 73 75 70 70 6f | 73 65 64 20 74 6f 20 72 |is suppo|sed to r|
|000023e0| 65 6c 65 61 73 65 20 74 | 68 65 20 70 6f 69 6e 74 |elease t|he point|
|000023f0| 65 72 20 69 6e 20 74 68 | 65 20 4f 6e 53 74 6f 70 |er in th|e OnStop|
|00002400| 42 69 6e 64 69 6e 67 20 | 6d 65 74 68 6f 64 2c 20 |Binding |method, |
|00002410| 73 6f 20 77 65 27 6c 6c | 0d 20 20 20 20 2f 2f 20 |so we'll|. // |
|00002420| 20 6d 61 6b 65 20 73 75 | 72 65 20 77 65 20 64 6f | make su|re we do|
|00002430| 6e 27 74 20 6c 65 61 6b | 20 61 6e 79 74 68 69 6e |n't leak| anythin|
|00002440| 67 20 62 79 20 6a 75 73 | 74 20 64 65 6c 65 74 69 |g by jus|t deleti|
|00002450| 6e 67 20 74 68 65 20 62 | 69 6e 64 69 6e 67 2e 0d |ng the b|inding..|
|00002460| 20 20 20 20 6d 5f 70 42 | 69 6e 64 69 6e 67 2d 3e | m_pB|inding->|
|00002470| 6d 5f 70 62 73 63 2d 3e | 4f 6e 53 74 6f 70 42 69 |m_pbsc->|OnStopBi|
|00002480| 6e 64 69 6e 67 28 68 72 | 2c 20 4e 55 4c 4c 29 3b |nding(hr|, NULL);|
|00002490| 0d 20 20 20 20 64 65 6c | 65 74 65 20 6d 5f 70 42 |. del|ete m_pB|
|000024a0| 69 6e 64 69 6e 67 3b 0d | 20 20 20 20 6d 5f 70 42 |inding;.| m_pB|
|000024b0| 69 6e 64 69 6e 67 20 3d | 20 4e 55 4c 4c 3b 0d 0d |inding =| NULL;..|
|000024c0| 20 20 20 20 2f 2f 20 20 | 57 65 27 72 65 20 74 68 | // |We're th|
|000024d0| 72 6f 75 67 68 20 77 69 | 74 68 20 74 68 69 73 20 |rough wi|th this |
|000024e0| 62 69 6e 64 69 6e 67 20 | 63 61 6c 6c 62 61 63 6b |binding |callback|
|000024f0| 20 6f 62 6a 65 63 74 2e | 20 20 54 68 65 20 75 73 | object.| The us|
|00002500| 65 72 20 6d 61 79 20 62 | 65 0d 20 20 20 20 2f 2f |er may b|e. //|
|00002510| 20 20 68 6f 6c 64 69 6e | 67 20 6f 6e 20 74 6f 20 | holdin|g on to |
|00002520| 6f 75 72 20 73 74 72 65 | 61 6d 20 6f 62 6a 65 63 |our stre|am objec|
|00002530| 74 20 74 68 6f 75 67 68 | 2c 20 73 6f 20 77 65 20 |t though|, so we |
|00002540| 6d 75 73 74 20 70 61 79 | 20 61 74 74 65 6e 74 69 |must pay| attenti|
|00002550| 6f 6e 20 74 6f 20 6f 75 | 72 0d 20 20 20 20 2f 2f |on to ou|r. //|
|00002560| 20 20 72 65 66 65 72 65 | 6e 63 65 20 63 6f 75 6e | refere|nce coun|
|00002570| 74 2e 0d 20 20 20 20 74 | 68 69 73 2d 3e 52 65 6c |t.. t|his->Rel|
|00002580| 65 61 73 65 28 29 3b 0d | 0d 20 20 20 20 72 65 74 |ease();.|. ret|
|00002590| 75 72 6e 20 4e 50 45 52 | 52 5f 4e 4f 5f 45 52 52 |urn NPER|R_NO_ERR|
|000025a0| 4f 52 3b 0d 7d 0d 00 00 | 00 00 00 00 00 00 00 00 |OR;.}...|........|
|000025b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002600| 00 00 01 00 00 00 01 7c | 00 00 00 7c 00 00 00 5e |.......||...|...^|
|00002610| 00 00 a1 8c 06 6d 69 73 | 63 2e 68 00 00 00 00 00 |.....mis|c.h.....|
|00002620| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002630| 0e 70 75 6c 6c 73 74 72 | 65 61 6d 2e 63 70 70 61 |.pullstr|eam.cppa|
|00002640| 02 00 00 00 50 61 72 74 | 53 49 54 21 00 00 00 00 |....Part|SIT!....|
|00002650| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00002660| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002670| 00 00 b0 56 8e 17 00 00 | 00 00 00 00 01 da 00 00 |...V....|........|
|00002680| 00 00 00 00 00 00 00 00 | 00 00 18 28 25 00 00 00 |........|...(%...|
|00002690| a2 61 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.a......|........|
|000026a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000026b0| 00 00 00 00 18 36 25 00 | 00 00 a2 61 0a 68 74 61 |.....6%.|...a.hta|
|000026c0| 6e 63 68 6f 72 2e 68 00 | 00 00 00 00 00 00 00 00 |nchor.h.|........|
|000026d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 18 a1 |........|........|
|000026e0| 25 00 00 00 a2 61 0a 68 | 74 68 65 61 64 65 72 2e |%....a.h|theader.|
|000026f0| 63 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |c.......|........|
|00002700| 00 00 00 1e 00 5a 00 04 | 03 53 02 63 00 5a 00 04 |.....Z..|.S.c.Z..|
|00002710| 03 53 02 63 00 00 00 00 | 00 00 00 00 00 00 00 00 |.S.c....|........|
|00002720| 00 00 00 00 00 48 00 09 | 4d 6f 6e 61 63 6f 00 00 |.....H..|Monaco..|
|00002730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002740| 00 00 00 00 00 00 00 00 | 00 03 00 04 00 5a 00 04 |........|.....Z..|
|00002750| 03 53 02 63 00 5a 00 04 | 03 53 02 63 b0 0b be b6 |.S.c.Z..|.S.c....|
|00002760| 00 00 21 72 00 00 21 72 | 00 00 1c 31 01 00 00 00 |..!r..!r|...1....|
|00002770| 00 02 00 00 00 00 00 04 | 00 01 00 01 00 00 01 00 |........|........|
|00002780| 00 00 01 7c 00 00 00 7c | 00 00 00 5e 03 89 3e 3c |...|...||...^..><|
|00002790| 24 ba 00 00 00 1c 00 5e | 00 01 4d 50 53 52 00 02 |$......^|..MPSR..|
|000027a0| 00 12 4d 57 42 42 00 00 | 00 36 03 f0 ff ff 00 00 |..MWBB..|.6......|
|000027b0| 00 00 00 00 00 00 03 ed | ff ff 00 00 00 22 00 00 |........|....."..|
|000027c0| 00 00 03 ef ff ff 00 00 | 00 6e 00 00 00 00 03 f0 |........|.n......|
|000027d0| ff ff 00 00 00 74 00 00 | 00 00 00 00 00 00 00 00 |.....t..|........|
|000027e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000027f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+